﻿using System;
using System.Configuration;
using System.Diagnostics.CodeAnalysis;

namespace JTLeigh.Commerce.Spencer.Core.Common.Services
{

    /// <summary>
    /// Service used to retrieve configuration data.
    /// </summary>
    public interface IConfigurationService
    {

        /// <summary>
        /// Retrieves the specified configuration section.
        /// </summary>
        /// <typeparam name="TSection">The type of <see cref="ConfigurationSection"/> to 
        /// retrieve.</typeparam>
        /// <param name="tenantId">The tenant identifier <see cref="Guid"/> of the tenant who the 
        /// configuration section is to be retrieved for.</param>
        /// <param name="sectionName">The configuration section name to retrieve.</param>
        /// <returns>The resulting <typeparamref name="TSection"/> object.</returns>
        [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Reviewed.")]
        TSection GetSection<TSection>(Guid tenantId, string sectionName)
            where TSection : ConfigurationSection;

    }

}
